/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * habitacionesControlT.java
 *
 * Created on 7/06/2012, 11:04:43 AM
 */

package presentacion;

import javax.swing.JOptionPane;
import negocios.Habitacion;

/**
 *
 * @author userlab18
 */
public class habitacionesControlT extends javax.swing.JDialog {

    /** Creates new form habitacionesControlT */
    public habitacionesControlT(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        txtNuevoCodigoHabitacion.setText(String.valueOf(1+ ControlHabitacionesView.lsthabitaciones.size()));
        txtNuevoNumeroHabitacion.setText(txtNuevoCodigoHabitacion.getText());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        lblNuevoCodigoHabitacion = new javax.swing.JLabel();
        txtNuevoCodigoHabitacion = new javax.swing.JTextField();
        lblNuevoNumeroHabitacion = new javax.swing.JLabel();
        txtNuevoNumeroHabitacion = new javax.swing.JTextField();
        lblNuevoNumeroHuespedes = new javax.swing.JLabel();
        txtNuevoNumeroHuespedes = new javax.swing.JTextField();
        lblNuevoCostoHabitacion = new javax.swing.JLabel();
        txtNuevoCostoHabitacion = new javax.swing.JTextField();
        btnNuevoLimpiar = new javax.swing.JButton();
        btnNuevoAceptar = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        btnModificarLimpiar = new javax.swing.JButton();
        btnModificarAceptar = new javax.swing.JButton();
        txtModificarCostoHabitacion = new javax.swing.JTextField();
        txtModificarNumeroHuespedes = new javax.swing.JTextField();
        txtModificarNumeroHabitacion = new javax.swing.JTextField();
        txtModificarCodigoHabitacion = new javax.swing.JTextField();
        lblModificarCodigoHabitacion = new javax.swing.JLabel();
        lblModificarNumeroHabitacion = new javax.swing.JLabel();
        lblModificarNuemeroHuespedes = new javax.swing.JLabel();
        lblModificarCostoHabitacion = new javax.swing.JLabel();
        btnModificarBuscarCodigo = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        lblEliminarCodigoHabitacion = new javax.swing.JLabel();
        txtEliminarCodigoHabitacion = new javax.swing.JTextField();
        lblEliminarNumeroHabitacion = new javax.swing.JLabel();
        txtEliminarNumeroHabitacion = new javax.swing.JTextField();
        lblEliminarNumeroHuesped = new javax.swing.JLabel();
        txtEliminarNumeroHuespedes = new javax.swing.JTextField();
        lblEliminarCostoHuesped = new javax.swing.JLabel();
        txtEliminarCostoHabitacion = new javax.swing.JTextField();
        btnEliminarLimpiar = new javax.swing.JButton();
        btnEliminarAceptar = new javax.swing.JButton();
        btnEliminarBuscarCodigo = new javax.swing.JButton();
        btnSalirHabitaciones = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        jPanel3.setName("jPanel3"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(presentacion.Laboratorio3App.class).getContext().getResourceMap(habitacionesControlT.class);
        lblNuevoCodigoHabitacion.setText(resourceMap.getString("lblNuevoCodigoHabitacion.text")); // NOI18N
        lblNuevoCodigoHabitacion.setName("lblNuevoCodigoHabitacion"); // NOI18N

        txtNuevoCodigoHabitacion.setText(resourceMap.getString("txtNuevoCodigoHabitacion.text")); // NOI18N
        txtNuevoCodigoHabitacion.setEnabled(false);
        txtNuevoCodigoHabitacion.setName("txtNuevoCodigoHabitacion"); // NOI18N

        lblNuevoNumeroHabitacion.setText(resourceMap.getString("lblNuevoNumeroHabitacion.text")); // NOI18N
        lblNuevoNumeroHabitacion.setName("lblNuevoNumeroHabitacion"); // NOI18N

        txtNuevoNumeroHabitacion.setEditable(false);
        txtNuevoNumeroHabitacion.setText(resourceMap.getString("txtNuevoNumeroHabitacion.text")); // NOI18N
        txtNuevoNumeroHabitacion.setName("txtNuevoNumeroHabitacion"); // NOI18N

        lblNuevoNumeroHuespedes.setText(resourceMap.getString("lblNuevoNumeroHuespedes.text")); // NOI18N
        lblNuevoNumeroHuespedes.setName("lblNuevoNumeroHuespedes"); // NOI18N

        txtNuevoNumeroHuespedes.setText(resourceMap.getString("txtNuevoNumeroHuespedes.text")); // NOI18N
        txtNuevoNumeroHuespedes.setName("txtNuevoNumeroHuespedes"); // NOI18N

        lblNuevoCostoHabitacion.setText(resourceMap.getString("lblNuevoCostoHabitacion.text")); // NOI18N
        lblNuevoCostoHabitacion.setName("lblNuevoCostoHabitacion"); // NOI18N

        txtNuevoCostoHabitacion.setText(resourceMap.getString("txtNuevoCostoHabitacion.text")); // NOI18N
        txtNuevoCostoHabitacion.setName("txtNuevoCostoHabitacion"); // NOI18N

        btnNuevoLimpiar.setText(resourceMap.getString("btnNuevoLimpiar.text")); // NOI18N
        btnNuevoLimpiar.setName("btnNuevoLimpiar"); // NOI18N
        btnNuevoLimpiar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnNuevoLimpiarMouseClicked(evt);
            }
        });

        btnNuevoAceptar.setText(resourceMap.getString("btnNuevoAceptar.text")); // NOI18N
        btnNuevoAceptar.setName("btnNuevoAceptar"); // NOI18N
        btnNuevoAceptar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnNuevoAceptarMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblNuevoNumeroHabitacion)
                    .addComponent(lblNuevoCodigoHabitacion)
                    .addComponent(lblNuevoNumeroHuespedes)
                    .addComponent(lblNuevoCostoHabitacion))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtNuevoNumeroHabitacion, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                    .addComponent(txtNuevoCostoHabitacion, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                    .addComponent(txtNuevoNumeroHuespedes, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                    .addComponent(txtNuevoCodigoHabitacion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE))
                .addGap(37, 37, 37)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(btnNuevoLimpiar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnNuevoAceptar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(58, 58, 58))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNuevoCodigoHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNuevoCodigoHabitacion))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNuevoNumeroHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNuevoNumeroHabitacion))
                .addGap(26, 26, 26)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNuevoNumeroHuespedes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNuevoNumeroHuespedes))
                .addGap(27, 27, 27)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNuevoCostoHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblNuevoCostoHabitacion))
                .addContainerGap(26, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(123, Short.MAX_VALUE)
                .addComponent(btnNuevoLimpiar)
                .addGap(18, 18, 18)
                .addComponent(btnNuevoAceptar)
                .addGap(16, 16, 16))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        btnModificarLimpiar.setText(resourceMap.getString("btnModificarLimpiar.text")); // NOI18N
        btnModificarLimpiar.setEnabled(false);
        btnModificarLimpiar.setName("btnModificarLimpiar"); // NOI18N
        btnModificarLimpiar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnModificarLimpiarMouseClicked(evt);
            }
        });

        btnModificarAceptar.setText(resourceMap.getString("btnModificarAceptar.text")); // NOI18N
        btnModificarAceptar.setEnabled(false);
        btnModificarAceptar.setName("btnModificarAceptar"); // NOI18N
        btnModificarAceptar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnModificarAceptarMouseClicked(evt);
            }
        });

        txtModificarCostoHabitacion.setName("txtModificarCostoHabitacion"); // NOI18N

        txtModificarNumeroHuespedes.setName("txtModificarNumeroHuespedes"); // NOI18N

        txtModificarNumeroHabitacion.setEditable(false);
        txtModificarNumeroHabitacion.setName("txtModificarNumeroHabitacion"); // NOI18N

        txtModificarCodigoHabitacion.setName("txtModificarCodigoHabitacion"); // NOI18N

        lblModificarCodigoHabitacion.setText(resourceMap.getString("lblModificarCodigoHabitacion.text")); // NOI18N
        lblModificarCodigoHabitacion.setName("lblModificarCodigoHabitacion"); // NOI18N

        lblModificarNumeroHabitacion.setText(resourceMap.getString("lblModificarNumeroHabitacion.text")); // NOI18N
        lblModificarNumeroHabitacion.setName("lblModificarNumeroHabitacion"); // NOI18N

        lblModificarNuemeroHuespedes.setText(resourceMap.getString("lblModificarNuemeroHuespedes.text")); // NOI18N
        lblModificarNuemeroHuespedes.setName("lblModificarNuemeroHuespedes"); // NOI18N

        lblModificarCostoHabitacion.setText(resourceMap.getString("lblModificarCostoHabitacion.text")); // NOI18N
        lblModificarCostoHabitacion.setName("lblModificarCostoHabitacion"); // NOI18N

        btnModificarBuscarCodigo.setText(resourceMap.getString("btnModificarBuscarCodigo.text")); // NOI18N
        btnModificarBuscarCodigo.setName("btnModificarBuscarCodigo"); // NOI18N
        btnModificarBuscarCodigo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnModificarBuscarCodigoMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(50, 50, 50)
                        .addComponent(lblModificarCodigoHabitacion)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtModificarCodigoHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(lblModificarNumeroHabitacion)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtModificarNumeroHabitacion))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblModificarNuemeroHuespedes)
                                    .addComponent(lblModificarCostoHabitacion))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtModificarCostoHabitacion, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
                                    .addComponent(txtModificarNumeroHuespedes, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE))))))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(btnModificarLimpiar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnModificarAceptar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(btnModificarBuscarCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblModificarCodigoHabitacion)
                    .addComponent(txtModificarCodigoHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnModificarBuscarCodigo))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblModificarNumeroHabitacion)
                            .addComponent(txtModificarNumeroHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblModificarNuemeroHuespedes)
                            .addComponent(txtModificarNumeroHuespedes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblModificarCostoHabitacion)
                            .addComponent(txtModificarCostoHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(45, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(74, 74, 74)
                        .addComponent(btnModificarLimpiar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnModificarAceptar)
                        .addGap(28, 28, 28))))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel2.setName("jPanel2"); // NOI18N

        lblEliminarCodigoHabitacion.setText(resourceMap.getString("lblEliminarCodigoHabitacion.text")); // NOI18N
        lblEliminarCodigoHabitacion.setName("lblEliminarCodigoHabitacion"); // NOI18N

        txtEliminarCodigoHabitacion.setText(resourceMap.getString("txtEliminarCodigoHabitacion.text")); // NOI18N
        txtEliminarCodigoHabitacion.setName("txtEliminarCodigoHabitacion"); // NOI18N

        lblEliminarNumeroHabitacion.setText(resourceMap.getString("lblEliminarNumeroHabitacion.text")); // NOI18N
        lblEliminarNumeroHabitacion.setName("lblEliminarNumeroHabitacion"); // NOI18N

        txtEliminarNumeroHabitacion.setEditable(false);
        txtEliminarNumeroHabitacion.setText(resourceMap.getString("txtEliminarNumeroHabitacion.text")); // NOI18N
        txtEliminarNumeroHabitacion.setName("txtEliminarNumeroHabitacion"); // NOI18N

        lblEliminarNumeroHuesped.setText(resourceMap.getString("lblEliminarNumeroHuesped.text")); // NOI18N
        lblEliminarNumeroHuesped.setName("lblEliminarNumeroHuesped"); // NOI18N

        txtEliminarNumeroHuespedes.setText(resourceMap.getString("txtEliminarNumeroHuespedes.text")); // NOI18N
        txtEliminarNumeroHuespedes.setName("txtEliminarNumeroHuespedes"); // NOI18N

        lblEliminarCostoHuesped.setText(resourceMap.getString("lblEliminarCostoHuesped.text")); // NOI18N
        lblEliminarCostoHuesped.setName("lblEliminarCostoHuesped"); // NOI18N

        txtEliminarCostoHabitacion.setText(resourceMap.getString("txtEliminarCostoHabitacion.text")); // NOI18N
        txtEliminarCostoHabitacion.setName("txtEliminarCostoHabitacion"); // NOI18N

        btnEliminarLimpiar.setText(resourceMap.getString("btnEliminarLimpiar.text")); // NOI18N
        btnEliminarLimpiar.setEnabled(false);
        btnEliminarLimpiar.setName("btnEliminarLimpiar"); // NOI18N
        btnEliminarLimpiar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnEliminarLimpiarMouseClicked(evt);
            }
        });

        btnEliminarAceptar.setText(resourceMap.getString("btnEliminarAceptar.text")); // NOI18N
        btnEliminarAceptar.setEnabled(false);
        btnEliminarAceptar.setName("btnEliminarAceptar"); // NOI18N

        btnEliminarBuscarCodigo.setText(resourceMap.getString("btnEliminarBuscarCodigo.text")); // NOI18N
        btnEliminarBuscarCodigo.setName("btnEliminarBuscarCodigo"); // NOI18N
        btnEliminarBuscarCodigo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnEliminarBuscarCodigoMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(50, 50, 50)
                        .addComponent(lblEliminarCodigoHabitacion)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtEliminarCodigoHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(lblEliminarNumeroHabitacion)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtEliminarNumeroHabitacion))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblEliminarNumeroHuesped)
                                    .addComponent(lblEliminarCostoHuesped))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtEliminarCostoHabitacion, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
                                    .addComponent(txtEliminarNumeroHuespedes, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE))))))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnEliminarBuscarCodigo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnEliminarLimpiar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnEliminarAceptar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(27, 27, 27))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblEliminarCodigoHabitacion)
                    .addComponent(txtEliminarCodigoHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnEliminarBuscarCodigo))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblEliminarNumeroHabitacion)
                            .addComponent(txtEliminarNumeroHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblEliminarNumeroHuesped)
                            .addComponent(txtEliminarNumeroHuespedes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblEliminarCostoHuesped)
                            .addComponent(txtEliminarCostoHabitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(45, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGap(74, 74, 74)
                        .addComponent(btnEliminarLimpiar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnEliminarAceptar)
                        .addGap(28, 28, 28))))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

        btnSalirHabitaciones.setText(resourceMap.getString("btnSalirHabitaciones.text")); // NOI18N
        btnSalirHabitaciones.setName("btnSalirHabitaciones"); // NOI18N
        btnSalirHabitaciones.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnSalirHabitacionesMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(21, Short.MAX_VALUE)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 502, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(208, 208, 208)
                .addComponent(btnSalirHabitaciones, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(243, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnSalirHabitaciones)
                .addContainerGap(17, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnNuevoLimpiarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnNuevoLimpiarMouseClicked
        // TODO add your handling code here:
        txtNuevoNumeroHabitacion.setText("");
        txtNuevoNumeroHuespedes.setText("");
        txtNuevoCostoHabitacion.setText("");
        
    }//GEN-LAST:event_btnNuevoLimpiarMouseClicked

    private void btnModificarLimpiarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnModificarLimpiarMouseClicked
        // TODO add your handling code here:
        txtModificarCostoHabitacion.setText("");
        txtModificarNumeroHuespedes.setText("");
        txtModificarNumeroHabitacion.setText("");
        txtModificarCodigoHabitacion.setText("");

    }//GEN-LAST:event_btnModificarLimpiarMouseClicked

    private void btnEliminarLimpiarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnEliminarLimpiarMouseClicked
        // TODO add your handling code here:
        txtEliminarCodigoHabitacion.setText("");
        txtEliminarNumeroHabitacion.setText("");
        txtEliminarNumeroHuespedes.setText("");
        txtEliminarCostoHabitacion.setText("");
    }//GEN-LAST:event_btnEliminarLimpiarMouseClicked

    private void btnSalirHabitacionesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSalirHabitacionesMouseClicked
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_btnSalirHabitacionesMouseClicked

    private void btnNuevoAceptarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnNuevoAceptarMouseClicked
        // TODO add your handling code here:
        Habitacion habitacion= new Habitacion();
        habitacion.setPrecio(Double.parseDouble(txtNuevoCostoHabitacion.toString()));
        habitacion.setPersonas(Integer.parseInt(txtNuevoNumeroHuespedes.toString()));
        habitacion.setNumeroHabitacion(Integer.parseInt(txtNuevoNumeroHabitacion.toString()));
        ControlHabitacionesView.lsthabitaciones.push(habitacion);
    }//GEN-LAST:event_btnNuevoAceptarMouseClicked

    private void btnModificarBuscarCodigoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnModificarBuscarCodigoMouseClicked
        // TODO add your handling code here:
        Habitacion habitacion;
        habitacion = new Habitacion();
        habitacion = (Habitacion) ControlHabitacionesView.lsthabitaciones.get(Integer.parseInt(txtModificarCodigoHabitacion.getText()));
        txtModificarNumeroHabitacion.setText(txtModificarCodigoHabitacion.getText());
        txtModificarNumeroHuespedes.setText(String.valueOf(habitacion.getPersonas()));
        txtModificarCostoHabitacion.setText(String.valueOf(habitacion.getPrecio()));
        btnModificarAceptar.enable(true);
        btnModificarLimpiar.enable(true);
    }//GEN-LAST:event_btnModificarBuscarCodigoMouseClicked

    private void btnModificarAceptarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnModificarAceptarMouseClicked
        // TODO add your handling code here:
        Habitacion habitacion;
        habitacion = new Habitacion();
        habitacion.setPrecio(Double.parseDouble(txtNuevoCostoHabitacion.toString()));
        habitacion.setPersonas(Integer.parseInt(txtNuevoNumeroHuespedes.toString()));
        habitacion.setNumeroHabitacion(Integer.parseInt(txtNuevoNumeroHabitacion.toString()));
        ControlHabitacionesView.lsthabitaciones.set(Integer.parseInt(txtModificarCodigoHabitacion.getText()), habitacion);
    }//GEN-LAST:event_btnModificarAceptarMouseClicked

    private void btnEliminarBuscarCodigoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnEliminarBuscarCodigoMouseClicked
        // TODO add your handling code here:
         Habitacion habitacion;
        habitacion = new Habitacion();
        habitacion = (Habitacion) ControlHabitacionesView.lsthabitaciones.get(Integer.parseInt(txtModificarCodigoHabitacion.getText()));
        txtEliminarNumeroHabitacion.setText(txtModificarCodigoHabitacion.getText());
        txtEliminarNumeroHuespedes.setText(String.valueOf(habitacion.getPersonas()));
        txtEliminarCostoHabitacion.setText(String.valueOf(habitacion.getPrecio()));
        btnEliminarAceptar.enable(true);
        btnEliminarLimpiar.enable(true);
    }//GEN-LAST:event_btnEliminarBuscarCodigoMouseClicked

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                habitacionesControlT dialog = new habitacionesControlT(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnEliminarAceptar;
    private javax.swing.JButton btnEliminarBuscarCodigo;
    private javax.swing.JButton btnEliminarLimpiar;
    private javax.swing.JButton btnModificarAceptar;
    private javax.swing.JButton btnModificarBuscarCodigo;
    private javax.swing.JButton btnModificarLimpiar;
    private javax.swing.JButton btnNuevoAceptar;
    private javax.swing.JButton btnNuevoLimpiar;
    private javax.swing.JButton btnSalirHabitaciones;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lblEliminarCodigoHabitacion;
    private javax.swing.JLabel lblEliminarCostoHuesped;
    private javax.swing.JLabel lblEliminarNumeroHabitacion;
    private javax.swing.JLabel lblEliminarNumeroHuesped;
    private javax.swing.JLabel lblModificarCodigoHabitacion;
    private javax.swing.JLabel lblModificarCostoHabitacion;
    private javax.swing.JLabel lblModificarNuemeroHuespedes;
    private javax.swing.JLabel lblModificarNumeroHabitacion;
    private javax.swing.JLabel lblNuevoCodigoHabitacion;
    private javax.swing.JLabel lblNuevoCostoHabitacion;
    private javax.swing.JLabel lblNuevoNumeroHabitacion;
    private javax.swing.JLabel lblNuevoNumeroHuespedes;
    private javax.swing.JTextField txtEliminarCodigoHabitacion;
    private javax.swing.JTextField txtEliminarCostoHabitacion;
    private javax.swing.JTextField txtEliminarNumeroHabitacion;
    private javax.swing.JTextField txtEliminarNumeroHuespedes;
    private javax.swing.JTextField txtModificarCodigoHabitacion;
    private javax.swing.JTextField txtModificarCostoHabitacion;
    private javax.swing.JTextField txtModificarNumeroHabitacion;
    private javax.swing.JTextField txtModificarNumeroHuespedes;
    private javax.swing.JTextField txtNuevoCodigoHabitacion;
    private javax.swing.JTextField txtNuevoCostoHabitacion;
    private javax.swing.JTextField txtNuevoNumeroHabitacion;
    private javax.swing.JTextField txtNuevoNumeroHuespedes;
    // End of variables declaration//GEN-END:variables

}
